<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>旅游首页</title>
    <link rel="stylesheet" href="../../css/amazeui.min.css">
    <link rel="stylesheet" href="css/app.css">
    <link rel="stylesheet" href="css/stylesy.css">

</head>
<body>


<div id='header' class="am-g am-topbar-fixed-top" style="padding:0 0;background:#ffaa43;height:auto;">
	<div  onclick="api.closeWin();"  class="am-u-sm-2" style="margin-top:12px;padding-left: 17px">
		<img  src="images/arr-l.png" style="height:14px;height: 18px;"/>
	</div> 
	<div class="am-u-sm-8 til" style="margin-top:13px;text-align:center;">
		<h1>旅游首页</h1>
	</div>
	<div class="am-u-sm-2" style="font-size: 20px;margin-top:10px;color:white;text-align:center;">

   </div>
   
</div>

<div class="am-g">
	<div class="am-u-sm-12" style="margin-top: 60px;padding: 0;" onclick="openWin('visa')">
	   <img src="images/top.jpg">
	</div>
</div>

<div class="am-g">
	<div class="am-u-sm-12">
	    欧洲，美洲，想走就走。高效，快捷，通过率高，无需再多收费！
	</div>
</div>

<div id="footer">
	<!--<div class="am-u-sm-12" style="padding: 0;">
	    <img src="images/top_1.jpg">
	    <img style="border-radius:5px;" class="tu" src="images/touxiang2.jpg">
	    
	      <div class="title3">体验极致老北京文化，传承华夏文明！
	          <div class="jiage1">￥1999</div>
	      </div>
	      
	    
	      <div class="title4">
	      	  <div class="title5">出发日期：2016年1月8日  25日  30日</div>
	          <div class="jiage2">￥1699</div>
	      </div>
	</div>-->
</div>



</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
	var tourlist = [];

	apiready = function(){
		loadData();
	};
	
	function loadData(){
		api.showProgress({
			title: '加载中...',
			modal: false
		});
		
		var url = serviceUrl + '/app/tour/route?limit=10';
	
		$api.get(url, function(ret){
			api.hideProgress();
			
		    if(ret){
		    	tourlist = ret.data;
		    	showlist();
		    }
		  
		},'json');
		
	}
	
	function showlist(){
		var aHtml = "";
	
		if(tourlist.length > 0){
			
			for(var i = 0; i < tourlist.length; i++){
				var tour = tourlist[i];
				
				aHtml += '<div class="am-u-sm-12" onclick="enterDetail(' + i + ')">';
				    aHtml += '<img src="' + serviceUrl + tour.proDefImg + '">';
				    
				      aHtml += '<div class="title3">' + tour.name;
				          aHtml += '<div class="jiage1">￥'+ tour.marketprice + '</div>';
				      aHtml += '</div>';
				    
				      aHtml += '<div class="title4">';
//				      	  aHtml += '<div class="title5">出发日期：2016年1月8日  25日  30日</div>';
				          aHtml += '<div class="jiage2">￥' + tour.price + '</div>';
				      aHtml += '</div>';
				aHtml += '</div>';
			}
		}
		
		$api.html($api.byId('footer'), aHtml);
	}
	
	function enterDetail(index){
		var tour = tourlist[index];
		
		openWin('tour_info', {'tour':tour});
	}
	
</script>
</html>